import { Component } from 'react'
// import Taro from "@tarojs/taro";
import { useSelector, useDispatch } from "react-redux";
import { View, Text, Button } from '@tarojs/components'
import './index.scss'
// import UserApi from '../../services/user'
export default (props) => {
    const dispatch = useDispatch();
    const { name, age } = useSelector((state) => state.user);
    const chageModel = () => {
        dispatch(
            {
                type: 'user/overrideStateProps',
                payload: {
                    name: "修改后的name"
                }

            }
        )
    }
    const requestLoin = () => {
        // UserApi.questMassage()
    }
    console.log("name", name)

    return <View><Text>首页</Text>
        <Button onClick={chageModel}>修改model数据</Button>
        <Button onClick={requestLoin}>请求测试</Button>
    </View>

}
